<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html style='height:100%;'>
<head>
<base href="<%=basePath%>">

<title>设计历史数据</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link rel="stylesheet" href="css/vivo.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="js/bootstrap2/css/bootstrap.min.css">
<link rel="stylesheet" href="js/bootstrap2/css/bootstrap-table.css">
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="js/font-awesome/css/font-awesome.css">
<link href="js/select2/select2.min.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css"
	href="static/p_house/house_index.css" />
<link rel="stylesheet" type="text/css"
	href="js/webuploader-0.1.5/webuploader.css" />

<script src="js/jquery-1.11.1.js"></script>
<script src="js/bootstrap2/js/bootstrap.min.js"></script>
<script src="js/bootstrap2/js/bootstrap-table.js"></script>
<script src="js/bootstrap2/js/bootstrap-table-zh-CN.js"></script>
<script type="text/javascript" src="js/layui-v2.1.5/layui/layui.all.js"></script>
<script type="text/javascript"
	src="<%=basePath%>js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="js/webuploader-0.1.5/webuploader.js"></script>
<script type="text/javascript" src="js/sharefunction.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script src="js/select2/select2.min.js"></script>
<!-- 图片放大 -->
<script src="js/postbird-img-glass/postbird-img-glass.js"></script>

</head>

<body style='height:100%'>
	<!-- 列表 -->
	<div style="padding:0 10px;height: 100%;">
		<div style="height: 100%;">
			<div style="height: 100%;">
				<!-- 列表start -->
				<div style="padding-top: 5px;" class="changeTable">
					<table id="table" style="table-layout:fixed">

					</table>
				</div>
				<!-- 列表end -->
				<!-- 表单start -->
				<div id="toCheckDesign" hidden="hidden" style="margin-top: 15px;height:calc(100% - 216px);">
					<iframe id="toDesignCheck" name="toCheckDesign" width="100%" style="height:100%;" frameborder="0"></iframe>
				</div>
				<!-- 表单end -->
			</div>
			<!-- 隐藏域 -->
			<div style="display: none">
				<input name="planId" id="planId">
			</div>
		</div>
	</div>
	<script type="text/javascript">
	
		function toCheck(id) {
			$("#toCheckDesign").show();
			$("iframe[id='toDesignCheck']").attr("src", "project/approval/toCheckDesignStage_"+id);
		}
		//表格-操作 - 格式化 
		function actionFormatter(value, row, index) {
			return "<a class='btn btn-info' onClick='toCheck(\"" + row.id + "\")'>查看</a>&nbsp;&nbsp;";
			//return "<a class='btn btn-info' onClick='check(\"" + row.id + "\")'>查看</a>&nbsp;&nbsp;<a class='btn btn-warning' onClick='del(\"" + row.id + "\")'>删除</a>";
		
		}
		//日期格式化
		function dataFormat(value, row, index) {
			return new Date(value).format("yyyy-MM-dd hh:mm:ss");
		}
		$(function() {
			//先销毁表格  
			//$('#table').bootstrapTable('destroy');  
			//初始化表格,动态从服务器加载数据  
			$("#table").bootstrapTable({
				method : "post", //使用get请求到服务器获取数据  
				url : "project/approval/getHistoryList", //获取数据的Servlet地址  
				striped : true, //表格显示条纹  
				pagination : true, //启动分页  
				pageSize : 10, //每页显示的记录数  
				pageNumber : 1, //当前第几页  
				pageList : [ 5, 10, 15, 20, 25 ], //记录数可选列表  
				sidePagination : "server", //表示服务端请求  
				contentType : 'application/x-www-form-urlencoded',
				//设置为undefined可以获取pageNumber，pageSize，searchText，sortName，sortOrder  
				//设置为limit可以获取limit, offset, search, sort, order  
				queryParamsType : "undefined",
				queryParams : function queryParams(params) { //设置查询参数  
					var param = {
						pageNumber : params.pageNumber,
						pageSize : params.pageSize,
						approvalId : '${approvalId}',
						type : '${type}'
					};
					return param;
				},
				columns : [ {
					field : 'createtime',
					title : '修改时间',
					width : '15%',
					formatter:dataFormat
				}, {
					field : 'fieldname',
					title : '修改字段',
					width : '7%'
				}, {
					field : 'changebefore',
					title : '修改前数据',
					width : '25%',
					formatter:showText	
				}, {
					field : 'changeafter',
					title : '修改后数据',
					width : '25%',
					formatter:showText	
				}, {
					field : 'adduser',
					title : '修改人',
					width : '7%',
				}, {
					field : 'remarks',
					title : '变更说明',
					width : '21%',
					formatter:showText	
				} ]
			});
		})
	</script>
</body>
</html>
